package dongshi.daddy.factory;

import dongshi.daddy.factory.factory.AbstractVehicleFactory;
import dongshi.daddy.factory.factory.BicycleFactory;
import dongshi.daddy.factory.factory.CarFactory;
import dongshi.daddy.factory.factory.PlaneFactory;
import dongshi.daddy.factory.product.Bicycle;
import dongshi.daddy.factory.product.Car;
import dongshi.daddy.factory.product.Plane;

public class FactoryTest {
    public static void main(String[] args) {
        // 生产自行车
        AbstractVehicleFactory<Bicycle> bicycleAbstractVehicleFactory = new BicycleFactory();
        bicycleAbstractVehicleFactory.makeProduct().sayHi();
        // 生产汽车
        AbstractVehicleFactory<Car> carAbstractVehicleFactory = new CarFactory();
        carAbstractVehicleFactory.makeProduct().sayHi();
        // 生产飞机
        AbstractVehicleFactory<Plane> planeAbstractVehicleFactory = new PlaneFactory();
        planeAbstractVehicleFactory.makeProduct().sayHi();
    }
}
